<script>
function UpdateGrpRoute() {
	document.Browse.action=document.Browse.action + "&grproute= "
	document.Browse.submit()
}
function BatchApply() {
	document.Browse.action=document.Browse.action + "&batch= "
	document.Browse.submit()
}
</script>
	<CFSETTING ENABLECFOUTPUTONLY="Yes">
	<!--- get records for the eform for browsing --->
	<CFSET sRecFilter = "">
	<CFIF len(trim(GetForm.RECORDFILTER)) NEQ 0>
		<CFIF eform.char EQ "all">
			<CFSET sRecFilter = " WHERE ">
		<CFELSE>
			<CFSET sRecFilter = " AND ">
		</CFIF>
		<CFIF lcase(left(GetForm.RECORDFILTER, 4)) EQ "self">
			<CFSET sRecFilter = sRecFilter & GetForm.PK_FIELD1 & "='" & client.chapa & "' " & mid(GetForm.RECORDFILTER, 5, len(GetForm.RECORDFILTER)-4)>
		<CFELSE>
			<CFSET sRecFilter = sRecFilter & GetForm.RECORDFILTER>
		</CFIF>
	</CFIF>
	<cfset client.getsrecfilter = sRecFilter>
	<CFSET lWithWhere=false>
	<CFQUERY NAME="GetData" DATASOURCE="#table_dsn#">
		SELECT *
		FROM #eform.tablename#
		<CFIF trim(eform.locator) NEQ "">
			WHERE (#eform.field# LIKE '%#eform.locator#%') #PreserveSingleQuotes(sRecFilter)#
			<CFSET lWithWhere=true>
		<CFELSE>
			<CFSET lWithWhere=true>

			<CFIF eform.char EQ "all">
				#PreserveSingleQuotes(sRecFilter)#
				<CFIF sRecFilter IS "">
					<CFSET lWithWhere=false>
				</CFIF>
			<CFELSEIF eform.char EQ "">
				WHERE (#eform.field# IS NULL) #PreserveSingleQuotes(sRecFilter)#
			<CFELSE>
				WHERE (#eform.field# LIKE '#eform.char#%') #PreserveSingleQuotes(sRecFilter)#
			</CFIF>
		</CFIF>

		<CFIF lWithWhere>
			AND (PERSONNELIDNO       = '#GetEmployee.PERSONNELIDNO#')
		<CFELSE>
			WHERE (PERSONNELIDNO       = '#GetEmployee.PERSONNELIDNO#')
		</CFIF>

		ORDER BY #eform.field# #eform.ascdesc#
	</CFQUERY>
	<CFIF GETFORM.ENABLEGROUPROUTE EQ "Y" AND GETFORM.PROCESSCODE NEQ "">
		<CFQUERY NAME="GetNotRouted" DATASOURCE="#table_dsn#">
			SELECT *
			FROM #eform.tablename#
			<CFIF trim(eform.locator) NEQ "">
				WHERE (#eform.field# LIKE '%#eform.locator#%') #PreserveSingleQuotes(sRecFilter)#
				<CFSET lWithWhere=true>
				<CFELSE>
					<CFSET lWithWhere=true>
	
				<CFIF eform.char EQ "all">
					#PreserveSingleQuotes(sRecFilter)#
					<CFIF sRecFilter IS "">
						<CFSET lWithWhere=false>
					</CFIF>
				<CFELSEIF eform.char EQ "">
					WHERE (#eform.field# IS NULL) #PreserveSingleQuotes(sRecFilter)#
				<CFELSE>
					WHERE (#eform.field# LIKE '#eform.char#%') #PreserveSingleQuotes(sRecFilter)#
				</CFIF>
			</CFIF>
	
			<CFIF lWithWhere>
				AND (PERSONNELIDNO = '#GetEmployee.PERSONNELIDNO#') AND ((ROUTEID IS NULL OR  ROUTEID = '') OR APPROVED = 'R')
			<CFELSE>
				WHERE (PERSONNELIDNO = '#GetEmployee.PERSONNELIDNO#') AND ((ROUTEID IS NULL OR  ROUTEID = '') OR APPROVED = 'R')
			</CFIF>
			ORDER BY #eform.field# #eform.ascdesc#
		</CFQUERY>
	</CFIF>


	<!--- get records for the eform for browsing --->
	<!--- old browse query ... do not delete this!!!!!
	<CFQUERY NAME="GetData" DATASOURCE="#table_dsn#">
		SELECT *
		FROM #eform.tablename#
		WHERE
		<CFIF trim(eform.locator) NEQ "">
			(#eform.field# LIKE '%#eform.locator#%') AND
		<CFELSE>
			<CFIF eform.char EQ "all">
			<CFELSEIF eform.char EQ "">
				(#eform.field# IS NULL) AND
			<CFELSE>
				(#eform.field# LIKE '#eform.char#%') AND
			</CFIF>
		</CFIF>
			(PERSONNELIDNO       = '#GetEmployee.PERSONNELIDNO#')

		ORDER BY #eform.field# #eform.ascdesc#
	</CFQUERY>
	--->

	<CFSETTING ENABLECFOUTPUTONLY="No">

	<CFSET appname = "Browse " & GetForm.DESCRIPTION>
	<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TITLE="#appname#">

	<CFOUTPUT>
	<CFIF sMess NEQ "">
		<B>#sMess#</B><BR>
	</CFIF>
	<CFIF sWarn NEQ "">
		<!---FONT COLOR="##FF0000"><B>#sWarn#</B></FONT><BR--->
		<CFQUERY NAME="getMessage" DATASOURCE="#client.global_dsn#">
			SELECT MESSAGECODE, MESSAGE
			FROM GRGBOSEMESSAGES
			WHERE COMPONENTCODE = '#session.tabid#'
		</CFQUERY>
		<CFLOOP QUERY="getMessage">
			<CFIF FindNoCase("#MESSAGECODE#",sWarn)>
				<script>
					<CFOUTPUT>
						alert("#MESSAGE#")
					</CFOUTPUT>
				</script>
			<CFELSE>
				<script>
					<CFOUTPUT>
						alert("#sWarn#")
					</CFOUTPUT>
				</script>
			</CFIF>
		</CFLOOP>
	</CFIF>
	<CFIF GetLevelID.LEVELID EQ "S">
		<cfset includeURLs="ID">
		<CFINCLUDE TEMPLATE="#client.common_path#cfm_selectsubcompanybar.cfm" >
	</CFIF>
	<FORM METHOD="post" ACTION="#eform.sender#" NAME="Browse">
	</CFOUTPUT>


	<CFINCLUDE TEMPLATE="_toolbar.cfm">

	<CFSET lFirstLoop=true>

	<!--- to browse on records --->
	<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=0 WIDTH="100%">
		<CFIF NOT GetData.RecordCount>
			<TR><TD CLASS="bold"><BR>No records found in the current filter.</TD></TR>
		<CFELSE>
			<CFOUTPUT>

			<TR bgcolor="#client.color_tblhead#">
				<TD></TD>

				<CFIF GetFormDetails.RecordCount>
					<TD></TD>
				</CFIF>
				<TD></TD>
				<CFSET iBrowseCtr = 0>
				<CFLOOP INDEX="x" FROM=1 TO="#arrayLen(arrFields)#">
					<CFIF #lcase(arrFields[x][4])# NEQ "y">
						<CFSET iBrowseCtr = iBrowseCtr + 1>
						<TD class="boldwhite" HEIGHT=18>&nbsp;#arrFields[x][2]#</TD>
					</CFIF>
				</CFLOOP>
			</TR>
			</CFOUTPUT>
			<!--- Get URL fields --->
			<CFSET sUrlFields = "">
			<CFLOOP INDEX="x" FROM="1" TO="5">
				<CFSET strPk_Field = evaluate("GetForm.PK_FIELD" & x)>
				<CFIF strPk_Field NEQ "" AND listFindNoCase(sUrlFields,strPk_Field) EQ 0>
					<CFSET sUrlFields = listAppend(sUrlFields,strPk_Field)>
				</CFIF>
			</CFLOOP>
			<CFLOOP QUERY="GetFormDetails">
				<CFLOOP INDEX="x" FROM="1" TO="5">
					<CFSET strLnk_Field = evaluate("GetFormDetails.LNK_FIELD" & x)>
					<CFIF strLnk_Field NEQ "" AND listFindNoCase(sUrlFields,strLnk_Field) EQ 0>
						<CFSET sUrlFields = listAppend(sUrlFields,strLnk_Field)>
					</CFIF>
				</CFLOOP>
			</CFLOOP>
			<!--- Get URL fields End--->
			<CFOUTPUT QUERY="GetData" StartRow="#form.startrow#" MaxRows="#OnEachPage#">
				<TR BGCOLOR=<CFIF CurrentRow Mod 2>"#client.color_tblset2#"<CFELSE>"#client.color_tblset1#"</CFIF> VALIGN="top">

					<!--- get the values of the indexed fields --->
					<CFSET sUFValue = "">
					<CFSET sFieldsValue = "">
					<CFSET session.sUFValue ="">
					<CFLOOP LIST="#sUrlFields#" INDEX="x">

						<CFSET sUFValue = sUFValue & "&" & x & "=" & URLEncodedFormat(evaluate("GetData." & x))>

					</CFLOOP>
					<CFIF isDefined("GetData.ATTACHMENTCODE")>
						<CFSET sUFValue = sUFValue & "&ATTACHMENTCODE=" & GetData.ATTACHMENTCODE>
					</CFIF>
					<!---
						<CFLOOP INDEX="x" FROM="1" TO="5">
							<CFSET strPk_Field = evaluate("GetForm.PK_FIELD" & x)>
							<CFSET strLnk_Field = evaluate("GetFormDetails.LNK_FIELD" & x)>
							<CFIF strPk_Field NEQ "" AND listFindNoCase(sFieldsValue,strPk_Field) EQ 0>
								<CFSET sUFValue = sUFValue & "&" & strPk_Field & "=" & URLEncodedFormat(evaluate("GetData." & strPk_Field))>
								<CFSET sFieldsValue = listAppend(sFieldsValue,strPk_Field)>
							</CFIF>
							<CFIF strLnk_Field NEQ "" AND listFindNoCase(sFieldsValue,strLnk_Field) EQ 0>
								<CFSET sUFValue = sUFValue & "&" & strLnk_Field & "=" & URLEncodedFormat(evaluate("GetData." & strLnk_Field))>
								<CFSET sFieldsValue = listAppend(sFieldsValue,strLnk_Field)>
							</CFIF>
						</CFLOOP>
					--->

					<CFSET lEdit = True>

					<CFIF (len(trim(ROUTEID)) NEQ 0 AND Trim(APPROVED) NEQ "R" AND Trim(APPROVED) NEQ "D") OR
						    lcase(APPROVED) EQ "y" OR lcase(APPROVED) EQ "C">
						<CFSET lEdit = False>
					</CFIF>

					<CFIF lFirstLoop>
						<CFSET lFirstLoop=false>
						<CFSET sDefault1="#sTypeID##sUFValue#">
						<CFSET sDefault2="#CurrentRow#">
					</CFIF>

					<!--- set the edit and delete functions --->
					<!---TD NOWRAP WIDTH="20%" CLASS="regular11"---><!---Modified by Badz 08132009 to adjust width according to its contents(Access)--->
					<TD NOWRAP ALIGN="CENTER" CLASS="regular11" wrap="virutal">
						<CFIF lLoadContainer>
							<CFIF CurrentRow Mod 2>
								<CFSET theColor = client.color_tblset2>
							<CFELSE>
								<CFSET theColor = client.color_tblset1>
							</CFIF>
							<li id="li#CurrentRow#" style="color: #theColor#" gridcolor="#theColor#"></li>
						</CFIF>

						<CFIF lcase(accessEdit) EQ "y" AND lEdit>
							&nbsp;
							<A CLASS="regular11" HREF="#eform.sender##sUFValue#&pid=#pidno#&edit=">edit</A>
						</CFIF>
						<CFIF lcase(accessEdit) EQ "y" OR lcase(accessView) EQ "y">
							&nbsp;
							<A CLASS="regular11" HREF="#eform.sender##sUFValue#&pid=#pidno#&view=" <!--- href="javascript:void(0)" onclick="viewForm()" ---> >view</A>
						</CFIF>

						<CFIF lcase(accessPrint) EQ "y">
							&nbsp;
							<A CLASS="regular11" HREF="###CreateUUID()#" ONCLICK="PrintWindow('#eform.senderURLs##sUFValue#&print=');">print</A>
						</CFIF>
						<CFIF lLoadContainer AND (lcase(accessView) EQ "y" OR lcase(accessEdit) EQ "y")>
							&nbsp;
							<A CLASS="regular11" HREF="###CreateUUID()#" ONCLICK="LoadContainer('#sTypeID##sUFValue#', '#CurrentRow#')">details</A>
						</CFIF>
						<!--- Modified by Mhel, Remove AND lEdit --->
						<CFIF lcase(accessAdd) EQ "y">
							&nbsp;
							<A CLASS="regular11" HREF="#eform.sender##sUFValue#&pid=#pidno#&replicate=">copy</A>
						</CFIF>
						<CFIF lcase(accessDelete) EQ "y" AND lEdit>
							&nbsp;
							<A CLASS="regular11" HREF="#eform.sender##sUFValue#&pid=#pidno#&delete="
												     <CFIF GetFormDetails.RecordCount>ONCLICK="return confirmThis('Delete this record? \nNOTE: This will delete all records in its infocards');"
					                                                             <CFELSE>ONCLICK="return confirmThis('Delete this record?');"
												     </CFIF>>delete</A>
						</CFIF>
						<CFIF lcase(accessEmail) EQ "y">
							&nbsp;
							<A CLASS="regular11" HREF="#eform.sender##sUFValue#&sendasemail=">email</A>
						</CFIF>
						&nbsp;

					<!--- Added by Mhel for copy to eForm --->
						<!--- Start --->
						<CFIF GetForm.COPYTOFORMCODE IS NOT "" AND GetData.APPROVED IS "Y">
							<CFQUERY NAME="qryCopyToeForm" DATASOURCE=#client.company_dsn#>
								SELECT DESCRIPTION
								FROM ECRGFORMS
								WHERE FORMCODE = '#GetForm.COPYTOFORMCODE#'
							</CFQUERY>
							<CFIF qryCopyToeForm.RecordCount>
								<CFSET session.sUFValue = #sUFValue#>
								<A CLASS="regular11" HREF="#eform.sender##sUFValue#&copytoeform=">copy to #qryCopyToeForm.DESCRIPTION#</A>
								&nbsp;
							</CFIF>
						</CFIF>
						<!--- End --->
					</TD>

					<CFIF GetFormDetails.RecordCount>
						<TD NOWRAP WIDTH=55 ALIGN="center">
							<CFSET sFormStatus = "">
							<CFIF not lEdit>
								<CFSET sFormStatus = "&formstatus=">
							</CFIF>
							&nbsp;<A CLASS="regular11" HREF="../flattbl_idx_2/index.cfm?id=#URLEncodedFormat(url.id)##sUFValue##sFormStatus#">infocard</A>&nbsp;
						</TD>
					</CFIF>
					<TD NOWRAP WIDTH=20 CLASS="regular11" VALIGN="TOP">
						<!--- kung may attachment, may paperclip --->
						<CFIF isDefined("GetData.ATTACHMENTCODE") AND GetData.ATTACHMENTCODE NEQ "">
							<CFQUERY NAME="qryAttachmentExist" DATASOURCE="#client.company_dsn#">
								SELECT * FROM ECINFORMSATTACH
								WHERE ATTACHMENTCODE = '#GetData.ATTACHMENTCODE#'
							</CFQUERY>
							<CFIF qryAttachmentExist.DESCRIPTION NEQ "">
								&nbsp;<img src="#client.icon_path#attachment.gif" height="15" width="15" align="center" valign="top" title="With Attachment">
							</CFIF>
						</CFIF>
					</TD>

					<CFLOOP INDEX="x" FROM=1 TO="#arrayLen(arrFields)#">
						<CFIF #lcase(arrFields[x][4])# NEQ "y">
							<CFSET sValue = #evaluate(arrFields[x][1])#>
							<CFSWITCH EXPRESSION="#lcase(arrFields[x][3])#">
								<CFCASE VALUE="ftdatetime">
									<TD NOWRAP HEIGHT=17>
										<CFIF sValue EQ "01/01/1900">
											&nbsp;
										<CFELSE>
											#DateFormat(sValue,"mmm d, yyyy")#
										</CFIF>
									</TD>
								</CFCASE>
								<CFCASE VALUE="ftfloat">
								<!--- Added by Mhel --->
								<!--- Start --->
								<CFSET sDecFormat=ToString(DecimalFormat(val(sValue)))>
								<CFIF Right(sDecFormat, 3) IS ".00">
									<CFSET sDecFormat=Replace(sDecFormat, ".00", "")>
								</CFIF>
								<!--- End --->
			    	  		<TD NOWRAP HEIGHT=17 ALIGN="right">
										&nbsp;#sDecFormat#
									</TD>
								</CFCASE>
								<CFCASE VALUE="ftinteger">
			    	  		<TD NOWRAP HEIGHT=17 ALIGN="right">
										&nbsp;#sValue#
									</TD>
								</CFCASE>
								<CFCASE VALUE="ftblob,ftgraphic">
						<TD NOWRAP HEIGHT=17 ALIGN="right">&nbsp;</TD>
								</CFCASE>

								<CFDEFAULTCASE>
			    	  		<TD HEIGHT=17>
										&nbsp;#sValue#
									</TD>
								</CFDEFAULTCASE>
							</CFSWITCH>
						</CFIF>
					</CFLOOP>
			  </TR>
			</CFOUTPUT>

			<CFOUTPUT>

			    <CFIF GetFormDetails.RecordCount>
					<CFSET iBrowseCtr = iBrowseCtr+3>
				<CFELSE>
					<CFSET iBrowseCtr = iBrowseCtr+2>
				</CFIF>

				<TR bgcolor="#client.color_tblfoot#">
					<TD class="white" HEIGHT=18 COLSPAN="#iBrowseCtr#">
						&nbsp;
						Records: <B>#form.startrow#-#EndRow#</B>
						&nbsp;of&nbsp;
						<B>#GetData.RecordCount#</B>
					</TD>
					<TD></TD>
				</TR>
			</CFOUTPUT>
		</CFIF>
	</TABLE>
	</FORM>
	<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TOP="False">

	<CFIF lLoadContainer>
		<!--- Added by Mhel for master-detail --->
		<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TITLE="Details">
		<TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH="100%">
		<CFOUTPUT>
		<TR>
			<TD ALIGN="right"><IMG SRC="#client.image_path##session.site_ibose#"></TD>
			<TD NOWRAP CLASS="bold14" WIDTH="100%"><FONT FACE="Impact" SIZE="+2">#client.companyname#</FONT><BR>#GetForm.DESCRIPTION#</TD>
		</TR>
		</CFOUTPUT>
		</TABLE>

		<form name="frmDetails">
		<TABLE BORDER=1 CELLSPACING=1 CELLPADDING=2 WIDTH="100%" BGCOLOR="#FFFFFF">
		<CFOUTPUT QUERY="GetFields" GROUP="FIELDGROUP">
			<CFIF len(trim(FIELDGROUP)) NEQ 0>
				<TR>
					<TD CLASS="bold11" BGCOLOR="#client.color_tblset2#" COLSPAN=3>
						&nbsp;#FIELDGROUP# #HINT#
					</TD>
				</TR>
			</CFIF>

			<CFOUTPUT>
			<TR VALIGN="top">
				<TD NOWRAP VALIGN="top" ALIGN="right">#COLUMNDESC#:</TD>
				<TD VALIGN="top" WIDTH="100%" HEIGHT=18 nowrap>&nbsp;
				<!--- check on what form control to use --->
				<CFSWITCH EXPRESSION="#lcase(COLUMNTYPE)#">

				<!--- calculator lookup --->
			    <CFCASE VALUE="ftinteger,ftfloat,ftdatetime">
					<input class="regular11" type="text" readonly name="#COLUMNNAME#" style="border: none;" SIZE="20">
				</CFCASE>

				<!--- memo fields --->
			    <CFCASE VALUE="ftmemo">
					<TEXTAREA class="regular11" ROWS="3" COLS="#DISPLAYWIDTH#" readonly name="#COLUMNNAME#" style="background-color: transparent; border: none; font-weight: bold; width: 99%;"></TEXTAREA>
				</CFCASE>

				<CFDEFAULTCASE>
					<CFSET sLkUpDescLength=PHYSICALWIDTH + 5>

					<!--- get lookup info --->
					<CFQUERY NAME="GetLookup" DATASOURCE="#client.global_dsn#">
							SELECT A.*, B.LEVELID
							FROM GSTLOOKUP A, GRGBOSETABLE B
							WHERE
								(A.MASTERTABLE = '#GetForm.TABLENAME_FK#') AND
								(A.MASTERFIELD = '#COLUMNNAME#') AND
								(A.LOOKUPTABLE = B.TABLENAME)
					</CFQUERY>
					<CFIF GetLookup.RecordCount>
						<CFIF (#trim(GetLookup.LEVELID)# NEQ "") AND
								(#trim(GetLookup.LOOKUPKEYFIELD)# NEQ "") AND
								(#trim(GetLookup.LOOKUPRESULTFIELD)# NEQ "") AND
								(#trim(GetLookup.LOOKUPTABLE)# NEQ "")>
							<!--- get the length of description --->
							<CFQUERY NAME="qryDescLength" DATASOURCE=#client.global_dsn#>
								SELECT PHYSICALWIDTH
								FROM GRGBOSETABLEFIELDS
								WHERE TABLENAME = '#GetLookup.LOOKUPTABLE#' AND
									  COLUMNNAME = '#GetLookup.LOOKUPRESULTFIELD#'
							</CFQUERY>

							<CFIF qryDescLength.PHYSICALWIDTH NEQ "" AND
									qryDescLength.PHYSICALWIDTH NEQ 0>
								<CFSET sLkUpDescLength=sLkUpDescLength + qryDescLength.PHYSICALWIDTH + 5>
							<CFELSE>
								<CFSET sLkUpDescLength=sLkUpDescLength + 50>
							</CFIF>

							<!--- for chart --->
							<CFIF LCase(ISORGCHART) IS "y">
								<A HREF="javascript:ShowChart('#Trim(GetLookup.LEVELID)#','#Trim(GetLookup.LOOKUPTABLE)#','#Trim(GetLookup.LOOKUPKEYFIELD)#','#Trim(GetLookup.LOOKUPRESULTFIELD)#','hid#COLUMNNAME#','frmDetails','#COLUMNDESC#')">show chart</A>&nbsp;&nbsp;
								<input type="hidden" name="hid#COLUMNNAME#">
							</CFIF>
						</CFIF>
					</CFIF>

					<input class="regular11" type="text" readonly name="#COLUMNNAME#" style="border: none;" SIZE="#sLkUpDescLength#">
				</CFDEFAULTCASE>
				</CFSWITCH>
				</TD>
			</TR>

			<!--- For extra desc in lookup --->
			<CFQUERY NAME="GetLookup" DATASOURCE=#client.global_dsn#>
					SELECT A.*, B.LEVELID
					FROM GSTLOOKUP A, GRGBOSETABLE B
					WHERE (A.MASTERTABLE = '#GetForm.TABLENAME_FK#') AND
						  (A.MASTERFIELD = '#COLUMNNAME#') AND
						  (A.LOOKUPTABLE = B.TABLENAME)
			</CFQUERY>

			<CFIF (GetLookup.RecordCount) AND trim(GetLookup.EXTRARESULTFLD) NEQ "">
				<!--- Get the description and datatype of display fields for lookup --->
				<CFSET sComma="">
				<CFQUERY NAME="qryDispLkUp" DATASOURCE=#client.global_dsn#>
					SELECT COLUMNNAME, COLUMNDESC, COLUMNTYPE, PHYSICALWIDTH, DISPLAYWIDTH
					FROM GRGBOSETABLEFIELDS
					WHERE (TABLENAME = '#Trim(GetLookup.LOOKUPTABLE)#') AND
						  (
						  	COLUMNNAME IN (
					  	<CFLOOP LIST="#GetLookup.EXTRARESULTFLD#" INDEX="x">
							#sComma# '#Trim(x)#'
							<CFSET sComma=",">
						</CFLOOP>
						  )
						  )
				</CFQUERY>
				<CFSET lstKeyValue=Valuelist(qryDispLkUp.COLUMNNAME)>

				<CFLOOP LIST="#GetLookup.EXTRARESULTFLD#" INDEX="x">
					<CFSET x = trim(x)>
					<TR VALIGN="top">

						<CFSET nPos=ListFindNocase(#lstKeyValue#, #x#)>
						<CFIF nPos NEQ 0>
							<CFSET sColDesc=#qryDispLkUp.COLUMNDESC[nPos]#>
							<CFSET sDataType=#qryDispLkUp.COLUMNTYPE[nPos]#>
							<CFSET sPhysicalWidth=#qryDispLkUp.PHYSICALWIDTH[nPos]#>
							<CFSET sDisplayWidth=#qryDispLkUp.DISPLAYWIDTH[nPos]#>
						<CFELSE>
							<CFSET sColDesc="">
							<CFSET sDataType="">
							<CFSET sPhysicalWidth="75">
							<CFSET sDisplayWidth="20">
						</CFIF>

						<CFIF NOT ListFindNoCase(sFields,#x#)>
						<TD NOWRAP VALIGN="top" ALIGN="right">#sColDesc#:</TD>
						<TD VALIGN="top" WIDTH="100%" HEIGHT=18 nowrap>&nbsp;<B>
							<CFSWITCH EXPRESSION="#lcase(sDataType)#">

							<!--- calculator lookup --->
						    <CFCASE VALUE="ftinteger,ftfloat,ftdatetime">
								<input class="regular11" type="text" readonly name="#x#" style="border: none;" SIZE="20">
							</CFCASE>

							<!--- memo fields --->
						    <CFCASE VALUE="ftmemo">
								<TEXTAREA class="regular11" ROWS="3" COLS="#sDisplayWidth#" readonly name="#x#" style="background-color: transparent; border: none; font-weight: bold;"></TEXTAREA>
							</CFCASE>

							<CFDEFAULTCASE>
								<input class="regular11" type="text" readonly name="#x#" style="border: none;" size=#sPhysicalWidth# + 5>
							</CFDEFAULTCASE>
							</CFSWITCH>
						</TD>
						</CFIF>
					</TR>
				</CFLOOP>
			</CFIF>
			</CFOUTPUT>
		</CFOUTPUT>
		</form>
		</TABLE>

		<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TOP="False">

		<script>
		var eFormHandle, sCurrentID

		<CFOUTPUT>
			<CFIF NOT lFirstLoop>
				LoadContainer("#sDefault1#", "#sDefault2#")
			</CFIF>
		</CFOUTPUT>


		function LoadContainer(sParam, sID) {
		var sValue=(typeof eFormHandle)

			if ((typeof sCurrentID) != "undefined")
				eval("document.all.li" + sCurrentID).style.color=eval("document.all.li" + sCurrentID).gridcolor

			eval("document.all.li" + sID).style.color="black"
			sCurrentID=sID

			<CFOUTPUT>
			if (sValue == "undefined")
				eFormHandle=open("detailpacket.cfm?id=" + sParam, "eformperid#session.sessionid#", "width=10,height=10,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes")
			else
				eFormHandle=open("detailpacket.cfm?id=" + sParam, "eformperid#session.sessionid#", "width=10,height=10,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes")
			</CFOUTPUT>

			if (sValue == "undefined")
				eFormHandle.moveTo(eFormHandle.screen.availWidth,eFormHandle.screen.availHeight)
		}
		</script>
	</CFIF>